package com.manu.checkloto;



import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.Toast;
import android.app.ListActivity;

public class CheckLotoActivity extends ListActivity {
	  //final EditText txtNumero = (EditText)findViewById(R.id.TxtNumero);
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
      
    	//final Button btnHola = (Button)findViewById(R.id.BtnHola);
        String[] values =  getResources().getStringArray(R.array.sorteo);
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
				android.R.layout.simple_list_item_1, values);
		setListAdapter(adapter);
    }

		protected void onListItemClick(ListView l, View v, int position, long id) {
			String item = (String) getListAdapter().getItem(position);
			Toast.makeText(this, "Has seleccionado "+item +  "\n esperamos que haya suerte", Toast.LENGTH_LONG).show();
			
			/*Intent intent = new Intent(this, CheckNum.class);
			 intent.putExtra("KEY_SELECTED_INDEX", position);
			startActivity(intent);
			*/
			Intent intent = new Intent(CheckLotoActivity.this, CheckNum.class);
		     
            Bundle bundle = new Bundle();
            bundle.putString("NUMERO", item);
            intent.putExtras(bundle);
     
            startActivity(intent);
		}
	

      
       /*btnHola.setOnClickListener(new OnClickListener() {
        public void onClick(View arg0) {
			// TODO Auto-generated method stub
			Intent intent = new Intent(CheckLotoActivity.this, CheckNum.class);
		     
            Bundle bundle = new Bundle();
            bundle.putString("NUMERO", txtNumero.getText().toString());
            intent.putExtras(bundle);
     
            startActivity(intent);
			
		}
    });*/
    }

	

	/*private void setListAdapter(ArrayAdapter<String> arrayAdapter) {
		// TODO Auto-generated method stub
		
	}*/
